#include "Suntracker.h"
#include "lcd.h"

#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <Flash.h>
#include <avr/wdt.h>   //WATCHDOG TIMER

//  -------- PINES DIGITALES ----------------------------------------

//Pines para los LED de nivel
#define RELAY_LEFT_D_PIN  7
#define RELAY_RIGHT_D_PIN 6
#define RELAY_UP_D_PIN    5
#define RELAY_DOWN_D_PIN  4

#define CALIBRATION_SWITCH_D_PIN 9

// -------- PINES ANALÓGICOS -------------------------

// ------- ABREVIATURAS

// -- OUTPUT
#define OUP     RELAY_UP_D_PIN
#define ODOWN   RELAY_DOWN_D_PIN
#define OLEFT   RELAY_LEFT_D_PIN
#define ORIGHT  RELAY_RIGHT_D_PIN


// -----------------------------------------------------------

#define SERIAL_BAUDRATE   57600
#define LOOP_DELAY         250 //ms

#define LCD_ROWS 2
#define LCD_COLS 16




#define DEBUG   //para poner/quitar salida datos por puerto serie

#ifdef DEBUG
  #define DEBUG_PRINT(x)  Serial << (x)
  #define DEBUG_PRINT2(x, y)  Serial.print (x, y)
#else
  #define DEBUG_PRINT(x)
  #define DEBUG_PRINT2(x, y)
#endif




Suntracker sensor;
Lcd lcd(LCD_ROWS, LCD_COLS);


//----------------------------------------------------------
#define ARROW_U  0
#define ARROW_D  1
#define ARROW_L  2
#define ARROW_R  3

byte arrowU[8] = {
        B00100,
        B01110,
        B11111,
        B00100,
        B00100,
        B00100,
        B00100,
        B00100
};

byte arrowD[8] = {
        B00100,
        B00100,
        B00100,
        B00100,
        B00100,
        B11111,
        B01110,
        B00100
};

byte arrowR[8] = {
        B00000,
        B00100,
        B00110,
        B11111,
        B00110,
        B00100,
        B00000,
        B00000
};

byte arrowL[8] = {
        B00000,
        B00100,
        B01100,
        B11111,
        B01100,
        B00100,
        B00000,
        B00000
};
